package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.nio.charset.StandardCharsets;

public class OosDemo1 {
    public static void main(String[] args) throws IOException {
        String name="范传奇";
        int age = 25;
        String gander = "男";
        String[]otherInfo={"帅","牛逼","厉害","大神"};
        Person1 person1= new Person1(name,age,gander,otherInfo);
        FileOutputStream fos = new FileOutputStream("text.txt");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        String str = "Never Marry";
        byte[]data = str.getBytes(StandardCharsets.UTF_8);
        oos.writeObject(data);
        oos.flush();
        System.out.println("数据写出完毕!");
        oos.close();
         
    }
}
